home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
mintprgs
/
mintupgr
/
disk7.zoo
/
elvis.zoo
/
usr
/
doc
/
elvis
/
differ.doc
< prev
next >
Wrap
Text File
|
1992-08-12
|
9KB
|
265 lines
_7. _D_I_F_F_E_R_E_N_C_E_S _B_E_T_W_E_E_N _E_l_v_i_s & _B_S_D _V_I/_E_X
Elvis is not 100% compatible with the real vi/ex.
Elvis has many small extensions, some omissions, and a few
features which are implemented in a slightly different
manner.
_7._1. _E_x_t_e_n_s_i_o_n_s
Save Configuration
The :mkexrc command saves the current :set and
:map configurations in the ".exrc" file in your
current directory.
Previous File
The :N or :prev command moves backwards through
the args list.
Center Current Row
In visual command mode, the (lowercase) "zz" com-
mand will center the current line on the screen,
like "z=".
Changing Repeat Count
The default count value for . is the same as the
previous command which . is meant to repeat. How-
ever, you can supply a new count if you wish. For
example, after "3dw", "." will delete 3 words, but
"5." will delete 5 words.
Previous Text
The text which was most recently input (via a "cw"
command, or something similar) is saved in a cut
buffer called ". (which is a pretty hard name to
write in an English sentence).
Keyword Lookup
In visual command mode, you can move the cursor
onto a word and press shift-K to have Elvis run a
reference program to look that word up. This com-
mand alone is worth the price of admission! See
the ctags and ref programs.
Increment/Decrement
In visual command mode, you can move the cursor
onto a number and then hit ## or #+ to increment
that number by 1. To increment it by a larger
amount, type in the increment value before hitting
the initial #. The number can also be decremented
or set by hitting #- or #=, respectively.
Input ModeYou can backspace past the beginning of the line.
The arrow keys work in input mode.
August 10, 1992
7-2 DIFFERENCES BETWEEN Elvis & BSD VI/EX 7-2
If you type control-A, then the text that you
input last time is inserted. You will remain in
input mode, so you can backspace over part of it,
or add more to it. (This is sort of like
control-@ on the real vi, except that control-A
really works.)
Control-P will insert the contents of the cut
buffer.
Real vi can only remember up to 128 characters of
input, but Elvis can remember any amount.
The ^T and ^D keys can adjust the indent of a line
no matter where the cursor happens to be in that
line.
You can save your file and exit Elvis directly
from input mode by hitting control-Z twice.
Elvis supports digraphs as a way to enter non-
ASCII characters.
Start in Input Mode
If you ":set inputmode" in your .exrc file, then
Elvis will start up in input mode instead of
visual command mode.
Visible Fonts
With ":set charattr", Elvis can display
"backslash-f" style character attributes on the
screen as you edit. The following example shows
the recognized atributes:
normal \fBboldface\fR \fIitalics\fR
\fUunderlined\fR normal
NOTE: you must compile Elvis without the
-DNO_CHARATTR flag for this to work.
File Syncing
After a crash, you can usually recover the altered
form of the file from the temporary file that
Elvis uses -- unless the temporary file was cor-
rupted.
UNIX systems use a delayed-write cache, which
means that when Elvis tries to write to the tem-
porary file, the information might still be in RAM
instead of on the disk. A power failure at that
time would cause the in-RAM information to be
lost. UNIX's sync() call will force all such
information to disk.
August 10, 1992
7-3 DIFFERENCES BETWEEN Elvis & BSD VI/EX 7-3
MS-DOS and Atari TOS don't write a file's length
to disk until that file is closed. Consequently,
the temporary file would appear to be 0 bytes long
if power failed when we were editing. To avoid
this problem, a sync() function has been written
which will close the temporary file and then
immediately reopen it.
Cursor Shape
Elvis changes the shape of the cursor to indicate
which mode you're in, if your terminal's termcap
entry includes the necessary capabilities.
Hide nroff Lines
Th ":set hideformat" option hides nroff format
control lines. (They are displayed on the screen
as blank lines.)
Compiler Interface
Elvis is clever enough to parse the error messages
emitted by many compilers. To use this feature,
you should collect your compiler's error messages
into a file called "errlist"; Elvis will read this
file, determine which source file caused the error
messages, start editing that file, move the cursor
to the line where the error was detected, and
display the error message on the status line.
Nifty!
Visible Text Selection
In visual command mode, 'v' starts visibly select-
ing characters and 'V' starts visibly selecting
whole lines. The character or line where the cur-
sor is located becomes one endpoint of the selec-
tion. You can then use the standard cursor move-
ment commands to move the cursor to the other end-
point, and then press one of the operator commands
(c/d/y/</>/!/=/\). The operator will then immedi-
ately be applied to the selected text.
Pop-up Menu Operator
The '\' key is a new operator, similar in opera-
tion to the c/d/y/</>/! operators It conjures up a
menu, from which you can select any of the other
operators plus a few other common commands.
Preset Filter Operator
The '=' key is another new operator. It is simi-
lar to the '!' operator, except that while '!'
asks you to type in a filter command each time,
'=' assumes it should always run the command
stored in the _e_q_u_a_l_p_r_g option.
Move to a Given Percentage
August 10, 1992
7-4 DIFFERENCES BETWEEN Elvis & BSD VI/EX 7-4
The '%' movement key can now accept an optional
count. Without a count, the '%' key still moves
to a matching parenthesis like it always did.
With a count somewhere between 1 and 100, though,
it moves the cursor to approximately a given per-
centage of the way through the file. For example,
typing "50%" will move the cursor to the middle of
the file.
Regular Expressions
In regular expressions, several new forms of clo-
sure operators are supported: \{_n}, \{_n,_m}, \+,
and \?.
_7._2. _O_m_i_s_s_i_o_n_s
The replace mode is a hack. It doesn't save the text
that it overwrites.
Long lines are displayed differently -- where the real
vi would wrap a long line onto several rows of the screen,
Elvis simply displays part of the line, and allows you to
scroll the screen sideways to see the rest of it.
The ":preserve" and ":recover" commands are missing.
So is the -r flag. I've never had a good reason to use
":preserve", and since ":recover" is used so rarely I
decided to implement it as a separate program. There's no
need to load the recovery code into memory every time you
edit a file, I figured.
LISP support is missing. However, the = key is still
an operator that reformats lines of text. By default, it
reformats lines by sending them through the _f_m_t filter, but
you could write your own LISP beautifier and configure elvis
to use it. Key mappings could take care of most other
differences. Auto-indent is the only thing that is irrecov-
erably lost.
Autoindent mode acts a little different from the real
vi, anyway. It doesn't handle ^^D or 0^D correctly. On the
other hand, it _d_o_e_s allow ^D and ^T to be used anywhere in
the line, to adjust the indentation for the whole line.
August 10, 1992